package com.input4hua.expr.time.handler.day;

import static com.input4hua.expr.time.untils.TimeFormatterUtils.TIME_FORMAT_PATTERN_YEARMONTHDAY;

import java.util.regex.Pattern;

/**
 * 支持的 ${TODAY}  极其相对偏移日期  输出yyyyMMdd
 * @author Jiahua.hu
 * @since 13 May 2019
 */
public class DayExprHandler extends AbstractDayExprHandler {

	private static final Pattern pattern = Pattern.compile("\\$\\{TODAY[\\+\\-]?\\d?}");

	@Override
	protected String exprParse(String expr) {
		return exprParse(expr, TIME_FORMAT_PATTERN_YEARMONTHDAY);
	}

	@Override
	protected Pattern getPattern() {
		return pattern;
	}
}
